package com.action.blog.black;

import java.util.Map;

import com.db.blog.black.*;
import com.opensymphony.xwork2.ActionContext;

public class BlackInsertAction {
	private String addID;
	private blackListManager black;

	public blackListManager getBlack() {
		return black;
	}

	public void setBlack(blackListManager black) {
		this.black = black;
	}

	public void setAddID(String addID) {
		this.addID = addID;
	}

	public String execute() throws Exception {

		addID = addID.trim();

		if (addID != null && addID != "") {
			blackListVO vo = new blackListVO();

			Map session = ActionContext.getContext().getSession();

			vo.setIdtype((String) session.get("login"));
			vo.setBlackid(addID);

			int chack = black.insertChack(vo);

			if (chack == 0)
				black.blackListInsert(vo);
		}

		return "success";

	}
}
